// 开发环境
const dev = {
    baseURL: 'http://localhost:7000/opsli-boot',
    contentType: 'application/json;charset=UTF-8',
    requestTimeout: 10000,
    successCode: [200, 0],
    tokenName: 'T-Authorization',
    invalidCode: 401,
    noPermissionCode: 403,
    rowLockCode: 409,
    loginInterception: true,//是否拦截登录
    storage: 'localStorage',
    debounce: ['doEdit']
};

// 生产环境
const prod = {
    baseURL: 'https://api.example.com',
    contentType: 'application/json;charset=UTF-8',
    requestTimeout: 10000,
    successCode: [200, 0],
    tokenName: 'T-Authorization',
    invalidCode: 401,
    noPermissionCode: 403,
    rowLockCode: 409,
    loginInterception: true,
    storage: 'localStorage',
    debounce: ['doEdit']
};

const config = import.meta.env.MODE === 'development' ? dev : prod;

export const {
    baseURL,
    contentType,
    requestTimeout,
    tokenName,
    successCode,
    invalidCode,
    noPermissionCode,
    rowLockCode,
    loginInterception,
    storage,
    debounce,
} = config;

export const publicPath = import.meta.env.VITE_PUBLIC_PATH || '/';
export const outputDir = import.meta.env.VITE_OUTPUT_DIR || 'dist';
export const assetsDir = import.meta.env.VITE_ASSETS_DIR || 'static';
export const lintOnSave = import.meta.env.VITE_LINT_ON_SAVE || true;
export const transpileDependencies = import.meta.env.VITE_TRANSPILE_DEPENDENCIES || [];
export const title = import.meta.env.VITE_TITLE || 'OPSLI 快速开发平台';
export const abbreviation = import.meta.env.VITE_ABBREVIATION || 'vab';
export const devPort = import.meta.env.VITE_DEV_PORT || '81';
export const version = import.meta.env.VITE_VERSION || '0.1';
export const copyright = import.meta.env.VITE_COPYRIGHT || 'vab';
export const footerCopyright = import.meta.env.VITE_FOOTER_COPYRIGHT || true;
export const progressBar = import.meta.env.VITE_PROGRESS_BAR || true;
export const keepAliveMaxNum = import.meta.env.VITE_KEEP_ALIVE_MAX_NUM || 99;
export const routerMode = import.meta.env.VITE_ROUTER_MODE || 'hash';
export const routesWhiteList = import.meta.env.VITE_ROUTES_WHITE_LIST || ['/login', '/register', '/auth/404', '/auth/401', '/auth/login', '/', '/public/', '/public'];
export const loadingText = import.meta.env.VITE_LOADING_TEXT || '正在加载中...';
export const tokenTableName = import.meta.env.VITE_TOKEN_TABLE_NAME || 'opsli-token';
export const recordRoute = import.meta.env.VITE_RECORD_ROUTE || true;
export const logo = import.meta.env.VITE_LOGO || 'opsli';
export const errorLog = import.meta.env.VITE_ERROR_LOG || ['development', 'test'];
export const encryptRSA = import.meta.env.VITE_ENCRYPT_RSA || true;
export const authentication = import.meta.env.VITE_AUTHENTICATION || 'all';
export const uniqueOpened = import.meta.env.VITE_UNIQUE_OPENED || true;
export const defaultOopeneds = import.meta.env.VITE_DEFAULT_OOPENEDS || ['/deve'];
export const providePlugin = import.meta.env.VITE_PROVIDE_PLUGIN || { maptalks: "maptalks", "window.maptalks": "maptalks" };
export const build7z = import.meta.env.VITE_BUILD_7Z || false;
export const templateFolder = import.meta.env.VITE_TEMPLATE_FOLDER || 'project';


